
import java.awt.Color;
import java.awt.GridLayout;
import java.util.ArrayList;
import javax.swing.ButtonGroup;
import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JToggleButton;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Atienza-Home
 */
public class FinalFrame2 extends javax.swing.JFrame {

    /**
     * Creates new form InitMain
     */
    
    
    public FinalFrame2(ArrayList<Fruit> arrfruits_, ArrayList<JButton> fbutton1_,
            ArrayList<JButton> fbutton2_,ArrayList<JButton> fbutton3_,
            ArrayList<JPanel> fpanel_, Basket basket_, ArrayList<JToggleButton> baskets_,
            ButtonGroup bgroup_, int basketi_, int bi_, String fruitmaxq_,
            String fruitpicked_, boolean iswin_) {
        
        setVisible(true);
        setResizable(false);
        initComponents();
        
        if(iswin_==false){
            jLabel5.setText("YOU ARE DEAD!");
            jScrollPane1.setBackground(Color.green);
            jScrollPane1.setViewportView(jLabel5);
            jButton5.setText("Revive Again");
        }else{
            jLabel5.setText("YOU ARE SAVED!");
            jScrollPane1.setBackground(Color.green);
            jScrollPane1.setViewportView(jLabel5);
            jButton5.setText("Arrest Again");         
            
        }
        bgroup_.clearSelection();
        baskets_.get(bi_).setBackground(Color.yellow);
        for(int i=0;i<arrfruits_.size();i++){
            jPanel3.add(baskets_.get(i));
            baskets_.get(i).setEnabled(false);
            jScrollPane2.setViewportView(jPanel3);
            
            
            JPanel panel = new JPanel();
            panel.setLayout(new GridLayout(3,1));
            
            
            
            if(fbutton2_.get(i).getText().equals(fruitpicked_)){
                fbutton1_.get(i).setBackground(Color.yellow);
                fbutton2_.get(i).setBackground(Color.yellow);
                fbutton3_.get(i).setBackground(Color.yellow);
                
            }
                
            jPanel5.add(fpanel_.get(i));
            jScrollPane4.setViewportView(jPanel5);
            
        }
        
        jLabel4.setText("You must pick a/an '"+fruitmaxq_+"', but you've picked:");
        
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">
    private void initComponents() {

        jScrollPane2 = new javax.swing.JScrollPane();
        jPanel3 = new javax.swing.JPanel();
        jScrollPane4 = new javax.swing.JScrollPane();
        jPanel5 = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jButton5 = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        jLabel5 = new javax.swing.JLabel();

        

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jPanel3.setPreferredSize(new java.awt.Dimension(635, 98));
        jPanel3.setLayout(new GridLayout(1,10));
        jScrollPane2.setBorder(null);
        jScrollPane2.setViewportView(jPanel3);

        jPanel5.setPreferredSize(new java.awt.Dimension(635, 98));
        jPanel5.setLayout(new GridLayout(1,10));
        jScrollPane4.setBorder(null);
        jScrollPane4.setViewportView(jPanel5);

        jLabel3.setFont(new java.awt.Font("Century Gothic", 0, 15)); // NOI18N
        jLabel3.setText("From basket:");

        jLabel4.setFont(new java.awt.Font("Century Gothic", 0, 15)); // NOI18N
        jLabel4.setText("You must pick , but you've picked:");

        jButton5.setText("Revive Again");

        jLabel5.setFont(new java.awt.Font("Century Gothic", 1, 25)); // NOI18N
        jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel5.setText("You are");
        
        jScrollPane1.setBorder(null);
        jScrollPane1.setViewportView(jLabel5);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane2)
            .addComponent(jScrollPane4)
            .addComponent(jButton5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel4)
                        .addContainerGap())
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel3)
                        .addContainerGap())))
            .addComponent(jScrollPane1)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 85, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel3)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel4)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        pack();
    }// </editor-fold>

    // Variables declaration - do not modify
    private javax.swing.JButton jButton5;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane4;
    // End of variables declaration
}
